﻿using System;

namespace BSharp.Compiler
{
	public abstract class AstNode
	{
		public readonly SourceLocation Location;

		public AstNode (SourceLocation location)
		{
			Location = location;
		}

		public abstract void Visit (AstVisitor visitor);

		public virtual void VisitChildren (AstVisitor visitor)
		{
		}

		public virtual bool Reduce (out AstNode newNode)
		{
			newNode = null;
			return false;
		}
	}
}

